<?php
namespace App\Model;
use PhalApi\Model\NotORMModel as NotORM;

class Gift extends NotORM {


	/* 礼物列表 */   	
    public function getGiftList() {

		$list=\PhalApi\DI()->notorm->gift
			->select("id,type,name,name_en,needcoin,thumb")
			->order("list_order asc,id desc")
			->fetchAll();
			

		return $list;
    }	
	
	/* 单个礼物信息 */
    public function getGiftInfo($id) {
        
        $info=\PhalApi\DI()->notorm->gift
                    ->select("id,type,name,name_en,thumb,needcoin,swftype,swf,swftime")
					->where('id=?',$id)
					->fetchOne();
        if($info){
			
			
            $info['thumb']=\App\get_upload_path($info['thumb']);
            $info['swf']=\App\get_upload_path($info['swf']);
        }
                
		return $info;
    }

}
